package com.weigecoder.warehouse.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * user_info表的实体类:
 */
//@ApiModel(description = "用户")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "user_info")
@JsonInclude(JsonInclude.Include.NON_NULL) //为空的字段不json序列化，则不返回前端显示
public class User {

	private int userId;//用户id

	// @ApiModelProperty(value = "账号")
	private String userCode;//账号

	//@ApiModelProperty(value = "用户名")
	private String userName;//用户名

	//@ApiModelProperty(value = "密码")
	private String userPwd;//用户密码

	//@ApiModelProperty(value = "用户类型")
	private String userType;//用户类型

	//@ApiModelProperty(value = "用户状态")
	private String userState;//用户状态

	//@ApiModelProperty(value = "删除状态")
	private String isDelete;//删除状态

	// @ApiModelProperty(value = "创建人")
	private int createBy;//创建人

	//返回前端时,自动将Date转换成指定格式的json字符串
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date createTime;//创建时间

	private int updateBy;//修改人

	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
	private Date updateTime;//修改时间

	// 追加的属性  ----------创建人
	private String getCode;


	public User(int userId, String userCode, String userName, String userPwd,
				String userType, String userState, String isDelete, int createBy,
				Date createTime, int updateBy, Date updateTime) {
		this.userId = userId;
		this.userCode = userCode;
		this.userName = userName;
		this.userPwd = userPwd;
		this.userType = userType;
		this.userState = userState;
		this.isDelete = isDelete;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
	}
}
